﻿using System;
using System.Collections.Generic;
using BotonJXC.Entity;
using BillLogDAO = BotonJXC.DAO.BillLogDAO;
using BotonJXC.Util;

namespace BotonJXC.BLL
{
    public class BillLogBLL : BaseBLL<BillLogDAO, BillLog, int>
    {
        public BillLogBLL()
        {
        }

        /// <summary>
        /// 保存单据操作日志
        /// </summary>
        /// <param name="optUser">操作用户</param>
        /// <param name="billId">单据ID</param>
        /// <param name="billSn">单据编号</param>
        /// <param name="billType">单据类型</param>
        /// <param name="billOperate">操作类型</param>
        /// <param name="remark">备注</param>
        public void SaveLog(Account optUser, int billId, string billSn, BillDetailType billType, BillOperate billOperate, string remark)
        {
            BillLog log = new BillLog();
            log.BillId = billId;
            log.BillSn = billSn;
            log.BillType = (int)billType;
            log.OperateTime = DateTime.Now;
            log.OperaterId = optUser.UserId;
            log.OperaterName = optUser.Realname;
            log.OperateType = (int)billOperate;
            log.Remark = remark;
            Save(log);
        }
    }
}